package cn.meomis.common.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.springframework.core.io.ClassPathResource;

public class PropertiesUtil {
	private static Properties config = null;
	private static String properties = "sys.properties";

	private PropertiesUtil() throws FileNotFoundException {
		ClassPathResource cr = new ClassPathResource(properties);
		config = new Properties();
		try {
			config.load(cr.getInputStream());
		} catch (IOException ex) {
			// System.out.println("file is not exist");
		}
	}
	
	

	public static String readValue(String key) {
		try {
			String value = config.getProperty(key);
			return value;
		} catch (Exception e) {
			e.printStackTrace();
			System.err.println("ConfigInfoError" + e.toString());
			return null;
		}
	}
}
